Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Function |saturating_mul

std/ops/num::|saturating_mul


Usage

|saturating_mul<N>(a, b)

Generics

◻ N: SaturatingMul

Parameters

↳ a: N
↳ b: N

Return

N


Multiply a and b, saturating to bounds.

This function is infaillible and saturate to the closest bound, minimal or maximal, if a × b is out of bounds for the data type.